package mybatis1.com.config.model;

import java.util.Objects;

public class Subject {
    private long id,classhour,gradeid;
    private String subjectname;

    public Subject() {
    }

    public Subject(String subjectname, long id) {
        this.id = id;
        this.subjectname = subjectname;
    }

    public Subject(long id) {
        this.id = id;
    }

    public Subject(long classhour, long gradeid, String subjectname) {
        this.classhour = classhour;
        this.gradeid = gradeid;
        this.subjectname = subjectname;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public long getClasshour() {
        return classhour;
    }

    public void setClasshour(long classhour) {
        this.classhour = classhour;
    }

    public long getGradeid() {
        return gradeid;
    }

    public void setGradeid(long gradeid) {
        this.gradeid = gradeid;
    }

    public String getSubjectname() {
        return subjectname;
    }

    public void setSubjectname(String subjectname) {
        this.subjectname = subjectname;
    }

    @Override
    public String toString() {
        return "Subject{" +
                "id=" + id +
                ", classhour=" + classhour +
                ", gradeid=" + gradeid +
                ", subjectname='" + subjectname + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Subject subject = (Subject) o;
        return id == subject.id;
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
